import {
  basicHomeData,
  basicMapData,
  baiscOnlineStatusType,
  CabinetType,
  detectionEntity,
  proportionEntity,
  TokenRequestData,
} from '@/types'

export type queryElectricCabinetRequestData = TokenRequestData

export interface ElectricCabinetPushData {
  boxId: number
  boxLoggingId: number
  category: string
  createdTime: string
  extensionData: string
  orderId: string
  remark: string
  type: string
  updatedTime: string
  userId: string
}
export interface ElectricCabinetFaultEntity {
  category: string
  createdTime: string
  deviceCode: string
  faultDescription: string
  faultId: number
  imageUrls: string
  latitude: number
  longtitude: number
  messageId?: any
  operationTime?: any
  operationUser?: any
  remark: string
  status: number
  updatedTime: string
  userId: number
  workOrderId?: any
}
export interface queryElectricCabinetResponseData {
  batteryTotal: number
  boxTotal: number
  chargingStationTotal: number
  pushData: basicHomeData<ElectricCabinetPushData[]>
  detection: basicHomeData<detectionEntity[]>
  record: basicHomeData<ElectricCabinetFaultEntity[]>
  proportion: basicHomeData<proportionEntity[]>
  getRealtimeDataset: basicHomeData<string[][]>
  getTrend: basicHomeData<string[][]>
  boxDataList: queryBoxDetectionResponseData[]
}
export type queryElectricCabinetResponse = ApiResponseData<queryElectricCabinetResponseData>

export interface queryBoxDetectionRequestData extends TokenRequestData {
  type: CabinetType
}
export interface queryBoxDetectionResponseData extends basicMapData {
  boxId: number
  boxCode: string
  boxLockId: string
  longtitude: string
  latitude: string
  boxOnlineStatus: baiscOnlineStatusType
  battery48VCount: number
  battery60VCount: number
  masterBatteryLevel: number
  updatedTime: string
}
export type queryBoxDetectionResponse = ApiResponseData<queryBoxDetectionResponseData[]>

export interface queryBoxDetailInfoRequestData extends TokenRequestData {
  produceId: string
}
export interface doorDataListEntity {
  batteryChargeStatus: string
  batteryChargeStatusTime: string
  batteryId: string
  batteryPowerLevel: string
  batteryPowerLevelNew: string
  batteryTime: string
  doorNumber: number
  doorStatus: string
  doorStatusTime: string
  empty: boolean
  faultStatus: string
  inputVoltage: string
  maintenanceStatus: string
  newBatteryInputVoltage: string
  newBatteryNumber: string
  newBatteryPowerLevel: string
  newBatterySize: string
  newBatteryTime: string
  newBatteryType: string
  newBatteryVersion: string
  newBatteryVoltageType: string
  statusChanging?: string
  statusChangingContext?: string
  statusChangingTime?: string
  tempMaintenanceStatus: string
}
export interface boxOperationEntity {
  batteryFeedback?: string
  batteryId: string
  batteryNumber: string
  batteryPowerLevel: string
  boxCode: string
  boxId: number
  boxLockId: string
  boxOperationId: number
  createdTime: string
  doorCloseTime?: string
  doorNumber: number
  doorOpenFeedback: string
  doorOpenTime: string
  extensionData: string
  inputVoltage: string
  operationData: string
  orderId: string
  type: string
  updatedTime: string
  userId: string
}
export interface queryBoxDetailInfoResponseData {
  address: string
  boxOperationList: boxOperationEntity[]
  dataDTO: queryBoxDetectionResponseData
  doorCount: number
  doorDataList: doorDataListEntity[]
  getChangePowerCount: string[][]
}
export type queryBoxDetailInfoResponse = ApiResponseData<queryBoxDetailInfoResponseData>
